﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections.ObjectModel;
using UMLTouch.Core.UI;
using System.Windows;

namespace UMLTouch.Core.Models
{
    public class AnchorSlot : DiagramAnchor
    {
        public ObservableCollection<AnchorPlug> Plugs { get; set; }

        public AnchorSlot(IDiagramItem parent, Point position)
            : base(parent, position)
        {
            Plugs = new ObservableCollection<AnchorPlug>();
            this.Anchor_Moved += new EventHandler<DiagramAnchorMovedEventArgs>(AnchorSlot_Anchor_Moved);
        }

        void AnchorSlot_Anchor_Moved(object sender, DiagramAnchorMovedEventArgs e)
        {
            foreach (var item in Plugs)
            {
                item.Move(e.Move);
            }
        }
    }
}
